/*
 * SvcRepairBO.java
 *
 * Created on March 23, 2007, 5:58 PM
 *
 */

package edu.byu.isys413.group1E.data;

/** SvcRepairBO contains the information for a Service_Repair Revenue Source.
 *  This class extends the RevenueSourceBO to obtain the common 
 * elements for revenue sources.
 *
 * @author Travis Kulbeth
 */
public class SvcRepairBO extends RevenueSourceBO{

    private String startDate = null;
    private String completeDate = null;
    private double laborHrs;
    private String employeeID = null;
    private String pickUpDate = null;
    private String lastNoticeDate = null;
    private String productID = null;
    private ProductBO product = null;
    private String contactMethod = null;
    private String transDate = null;
    private boolean coveredByWarranty = false;
    
    /** Creates a new instance of SvcRepairBO */
    public SvcRepairBO() {
        this.setType("repair");
    }
        
    /** Creates a new instance of SvcRepairBO
     *with a unique identifier.
     *@param id contains the unique id for this object in the DB.
     */
    public SvcRepairBO(String id){
        this.setType("repair");
        this.setIsDirty(true);
        this.setRevSrcID(id);
    }

    /** Returns the start date for this svcRepair
     *@return startDate
     */
    public String getStartDate() {
        return startDate;
    }

    /** Sets the start date for this svcRepair.
     *@param startDate contains the starting date for this repair.
     */
    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    /** Returns the completion date for this repair.
     *@return completeDate
     */
    public String getCompleteDate() {
        return completeDate;
    }

    /** Sets the completion date for this repair
     *@param completeDate contains the completion date.
     */
    public void setCompleteDate(String completeDate) {
        this.completeDate = completeDate;
    }

    /** Returns the labor hours for this repair.
     *@return laborHrs
     */
    public double getLaborHrs() {
        return laborHrs;
    }

    /** Sets the labor hours for this repair.
     *@param laborHrs contains the labor hours for this repair.
     */
    public void setLaborHrs(double laborHrs) {
        this.laborHrs = laborHrs;
    }

    /** Returns the employeeID for the employee that performed
     *this repair.
     *@return employeeID
     */
    public String getEmployeeID() {
        return employeeID;
    }

    /** Sets the employee id for this repair.
     *@param employeeID contains the id of the employee who performed the repair.
     */
    public void setEmployeeID(String employeeID) {
        this.employeeID = employeeID;
    }
    
    /** Returns the employeeBO for the employee that performed this repair, if requested.
     *@return EmployeeBO
     */
    public EmployeeBO getEmployee() throws Exception{
        return EmployeeDAO.getInstance().read(this.employeeID);
    }

    /** Returns the pickup date for the repaired product.
     *@return pickUpDate
     */
    public String getPickUpDate() {
        return pickUpDate;
    }

    /** Sets the pickup date for this repair.
     *@param pickUpDate contains the date the repaired product was repaired.
     */
    public void setPickUpDate(String pickUpDate) {
        this.pickUpDate = pickUpDate;
    }

    /** Returns the date of the last notice sent to the customer.
     *@return lastNoticeDate
     */
    public String getLastNoticeDate() {
        return lastNoticeDate;
    }

    /** Sets the lastNoticeDate for this repair.
     *@param lastNoticeDate
     */
    public void setLastNoticeDate(String lastNoticeDate) {
        this.lastNoticeDate = lastNoticeDate;
    }

    /** Returns the id for the product that was repaired.
     *@return productID
     */
    public String getProductID() {
        return productID;
    }

    /** Sets the id for the product repaired.
     *@param productID
     */
    public void setProductID(String productID) {
        this.productID = productID;
    }

    /** Returns the product that was repaired.
     *@return product
     */
    public ProductBO getProduct() {
        return product;
    }

    /** Sets the product to be repaired.
     *@param product contains the product BO for this repair
     */
    public void setProduct(ProductBO product) {
        this.product = product;
    }
    
    /** Returns the customer's preferred method of contact.
     *@return contactMethod
     */
    public String getContactMethod() {
        return contactMethod;
    }

    /** Sets the customer's preferred method of contact for this repair.
     *@param contactMethod contains the customer's described preferred method of contact.
     */
    public void setContactMethod(String contactMethod) {
        this.contactMethod = contactMethod;
    }

    /** Returns the transaction date for the product's purchase by the customer
     *@return transDate
     */
    public String getTransDate() {
        return transDate;
    }

    /** Sets the date the customer purchased the product
     *@param transDate contains the transaction date for when the product was sold
     */
    public void setTransDate(String transDate) {
        this.transDate = transDate;
    }

    /** Returns the warranty coverage status
     *@return coveredByWarranty
     */
    public boolean isCoveredByWarranty() {
        return coveredByWarranty;
    }

    /** Sets the option of whether the warranty covers this repair or not.
     *@param coveredByWarranty indicates if the warranty covers this repair
     */
    public void setCoveredByWarranty(boolean coveredByWarranty) {
        this.coveredByWarranty = coveredByWarranty;
    }
}
